<?php
	error_reporting(0);
	session_start();
	error_reporting(1);		
	
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


<html>
	<head>
		<title>The Pin Project | Forum</title>
		<link rel="icon" type="image/ico" href="../favicon.ico" />
		<link rel="stylesheet" type="text/css" href="/members/frame.css" />
		<link rel="stylesheet" type="text/css" href="/members/profile.css" />
		<link rel="stylesheet" type="text/css" href="forum.css" />
	</head>
	
	<body>
		<div class="wrapper">
		
			<div class="top">
				<a href="/"><img src="img/logo.png" border=0/></a>
			</div>
		
			
			<div class="side">
				Side navigation links				
			</div>	
			
			<div class="mainarea">
				<div class="corner_ul">
					<img src="img/corner_ul.gif" />
				</div>
				
				<div class="tab_bar" style="position: relative; left: 45px; width: 600px">
					<?php
						if ( !$_SESSION['username'] )
						{
							?>
							<span class="tab" id="login_tab" onmouseover="TabHoverOn('login_tab');" onmouseout="TabHoverOff('login_tab');" onclick="TabSetActive('login_tab');">
								Login
							</span>
							<span class="tab" id="register_tab" onmouseover="TabHoverOn('register_tab');" onmouseout="TabHoverOff('register_tab');" onclick="TabSetActive('register_tab');">
								Register
							</span>
							
						<?php	}	else	{	?>
							<span class="tab" id="members_tab" onmouseover="TabHoverOn('members_tab');" onmouseout="TabHoverOff('members_tab');" onclick="TabSetActive('members_tab');">
								View Users
							</span>
							<span class="tab" id="profile_tab" onmouseover="TabHoverOn('profile_tab');" onmouseout="TabHoverOff('profile_tab');" onclick="TabSetActive('profile_tab');">
								Go to Profile
							</span>
						<?php	}	?>
							<span class="tab" id="home_tab" onmouseover="TabHoverOn('home_tab');" onmouseout="TabHoverOff('home_tab');" onclick="TabSetActive('home_tab');">
								Home
							</span>
				</div>

				<div id="contentarea">				
<?php

	$tab = $_GET["page"];
	
	if (!$tab)
	{
		$tab = "home";
	}
	
	include $tab . ".php";

?>
				</div>
				
			</div>
			
			
		</div>
	</body>
</html>



<script type="text/javascript">
	<?php if ($tab) { ?>
	var tab_activeItem = document.getElementById("<?php echo $tab ?>_tab");
	<?php } ?>
	
	TabSetInitial("<?php echo $tab ?>_tab");
	
	function TabHoverOn(destID)
	{
		destObj = document.getElementById(destID);
		
		if (destObj != tab_activeItem)
		{
			destObj.className = "tab_hover";
		}
	}

	function TabHoverOff(destID)
	{
		destObj = document.getElementById(destID);
		
		if (destObj != tab_activeItem)
		{
			destObj.className = "tab";
		}
	}

	function TabSetActive(destID)
	{
		destObj = document.getElementById(destID);
		
		if (tab_activeItem != null)
		{
               tab_activeItem.className = "tab";
		}
		tab_activeItem = destObj;
		
		
		destObj.className = "tab_active";
		
		top.location = "frame.php?tab=" + tab_activeItem.id.split("_")[0];
	}
	
	function TabSetInitial(destDivID)
	{		
		document.getElementById(destDivID).className = "tab_active";
	}
</script>